This method calculates the Stochastic Relative Strength Index.
var STOCHRSI(period, fastKPeriod, fastDPeriod, maType, dataArray, calculatedFastKArray, calculatedFastDArray);
period
Period integer value.
fastKPeriod
Fast K period integer value.
fastDPeriod
Fast D period integer value.
maType
One of the Moving Average constants.
dataArray
Array object filled with any data which will be used as the source for calculation.
calculatedFastKArray
Empty Array object that will be filled with fast K calculated data.
calculatedFastDArray
Empty Array object that will be filled with fast D calculated data.
Returns true if calculation was completed successfully, or false otherwise.
The following example demonstrates how to use STOCHRSI method.
function calculate(beginIndex, endIndex)
{
var period = 20;
var fastKPeriod = 15;
var fastDPeriod = 5;
var maType = TechnicalAnalysis.MA_EMA;
var dataArray = new Array();
//populate data array..
..
var calculatedFastKArray = new Array();
var calculatedFastDArray = new Array();
var rc = TechnicalAnalysis.STOCHRSI(period, fastKPeriod, fastDPeriod, maType, dataArray,
calculatedFastKArray, calculatedFastDArray);
}
Copyright © 2006-2009 ActiveTick LLC